local qingshi = fk.CreateSkill{
    name = "ym2__qingshi",
    tags = {Skill.Compulsory},
    dynamic_desc = function (self, player, lang)
        if player:usedSkillTimes("ym2__xuechou", Player.HistoryGame) == 0 then
            return "锁定技，你的回合开始时，视为使用一张【桃园结义】；当有角色因此法回复体力前，你可改为与其各摸一张牌。"
        else
            return "锁定技，你的回合开始时，视为使用一张【万箭齐发】；当有角色因此法回复体力前，你可改为与其各摸一张牌。"
        end
    end,
}
Fk:loadTranslationTable{
    ["ym2__qingshi"] = "倾世",
    [":ym2__qingshi"] = "锁定技，你的回合开始时，视为使用一张【桃园结义】；当有角色因此法回复体力前，你可改为与其各摸一张牌。",
    ["#ym2__qingshi-recover"] = "倾世：%dest 即将回复体力，是否改为与其各摸一张牌",
}
qingshi:addEffect(fk.TurnStart,{
    can_trigger = function (self, event, target, player, data)
        local name = "god_salvation"
        if player:usedSkillTimes("ym2__xuechou", Player.HistoryGame) > 0 then name = "archery_attack" end
        local card = Fk:cloneCard(name)
        card.skillName = qingshi.name
        return player == target and player:hasSkill(qingshi.name) and not player:prohibitUse(card)
    end,
    on_cost = Util.TrueFunc,
    on_use = function (self, event, target, player, data)
        local room = player.room
        local name = "god_salvation"
        if player:usedSkillTimes("ym2__xuechou", Player.HistoryGame) > 0 then name = "archery_attack" end
        local card = Fk:cloneCard(name)
        card.skillName = qingshi.name
        local tos = table.filter(room.alive_players, function(p)
            return player:canUseTo(card, p)
        end)
        if #tos > 0 then
            room:sortByAction(tos)
            room:useVirtualCard(name, nil, player, tos, qingshi.name)
        end
    end,
})
qingshi:addEffect(fk.PreHpRecover,{
    can_refresh = function (self, event, target, player, data)
        local use_event = player.room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
        if use_event then
            return data.recoverBy == player and data.skillName == "god_salvation_skill" and use_event.data.from == player and use_event.data.card.trueName == "god_salvation" and use_event.data.card.skillName == qingshi.name
        end
    end,
    on_refresh = function (self, event, target, player, data)
        local room = player.room
        if room:askToSkillInvoke(player,{
            skill_name = qingshi.name,
            prompt = "#ym2__qingshi-recover::"..target.id
        }) then
            data:preventRecover()
            target:drawCards(1, qingshi.name)
            if not player.dead then
                player:drawCards(1, qingshi.name)
            end
        end
    end,
})
return qingshi